derivative of square root using chain rule